/* SPDX-License-Identifier: GPL-2.0-or-later */
/* -*- mode: c; c-basic-offset: 8; -*-
 * vim: noexpandtab sw=8 ts=8 sts=0:
 *
 * ocfs2_heartbeat.h
 *
 * On-disk structures for ocfs2_heartbeat
 *
 * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
 */

#ifndef _OCFS2_HEARTBEAT_H
#define _OCFS2_HEARTBEAT_H

#include "nodemanager.h"

#define MAX_HOSTS	64

#pragma pack(2)
struct o2hb_disk_heartbeat_node {
	__le16 host_id;
	__le32 host_generation;
};
#pragma pack()

struct o2hb_disk_heartbeat_block {
	__le64 hb_seq;
	__le16 hb_node;
	__u8 hb_ipnet_type;
	__u8 hb_pad1[1];
	__le32 hb_cksum;
/* 10 */	__le64 hb_generation;
	__le32 hb_dead_ms;  /* cpu_to_le32(o2hb_real_dead_threshold *
						 * O2HB_REGION_TIMEOUT_MS) */
	__le16 hb_qs_effect_nodes;
	__le16 hb_qs_lowest_node;
	/* add hb_ipv4_address, write the IP address on the
	 * heartbeat region */
/* 20 */	union {
		__le32 hb_ipv4_address;
		__u8 hb_ipv6_address[16];
	} ip_addr;
/* 30 */	struct o2hb_disk_heartbeat_node hr_nodes[MAX_HOSTS];
/* 1B0 */	__u8 hb_lock_type; /* 0: DLM, 1: ADL */
};

#endif /* _OCFS2_HEARTBEAT_H */
